AC_INIT([Caixa], [1.5.2], [suporte@tabelionatooliveira.com.br],[caixa],[http://www.alcionesytes.net/])
AC_PREREQ([2.50])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([gnu 1.11 -Wall])
AM_INIT_AUTOMAKE([dist-xz])
AC_CONFIG_MACRO_DIR([m4])
m4_pushdef([AC_INCLUDES_DEFAULT], [$1])
AC_COPYRIGHT([Alcione Ferreira])
AC_REVISION([$Revision: 1.5.2 $])

AC_CANONICAL_HOST

AC_PROG_CXX
AC_LANG([C++])

######################################################################
# DOXYGEN SUPPORT
######################################################################

DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(ON)
DX_PS_FEATURE(ON)

DX_INIT_DOXYGEN([$PACKAGE_NAME],[doxygen.cfg],[doc])

######################################################################

AC_HEADER_STDC
AC_CHECK_HEADERS([iostream string fstream vector memory libex.h bancopg.h bancomy.h])
AC_CHECK_HEADERS([cstdio cstdlib hpdf.h zlib.h cmath])
AC_CHECK_LIB([m], [floor])
PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.10])
PKG_CHECK_MODULES([Zlib], [libzip >= 0.9])
PKG_CHECK_MODULES([PNG], [libpng12 >= 1.2])
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8])

AC_DEFINE([IMG_PATH],["img/"],[Diretório Padrão das imagens])
AC_DEFINE([CONF_FILE],["conf/db.conf"],[Arquivo de Configuração])
AC_DEFINE([CONF_FILE1],["conf/db-pt.conf"],[Arquivo de Configuração])
AC_DEFINE([CONF_FILE2],["conf/db-nt.conf"],[Arquivo de Configuração])
AC_DEFINE([CONF_FILE3],["conf/db-sl.conf"],[Arquivo de Configuração])
AC_CHECK_FILES([src/bibliotecas.h src/principal.h src/imprimir.h src/recibo.h src/relatorio.h])


AC_TYPE_SIZE_T

LIBEX
LIBBANCOPG
LIBBANCOMY
LIBHPDF
CHECK_OS

AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_SUBST([AM_LDADD])

AC_PREFIX_DEFAULT([~/programas/caixa])

AH_TOP([
#ifndef __CONFIGB_H__
#define __CONFIGB_H__ 1

#if  defined(__WIN32__) || defined(__WIN__)
#define NO_LINUX 1
#include <windows.h>
#endif
])
AH_BOTTOM([
#ifdef HAVE_IOSTREAM
# include <iostream>
#endif
#ifdef HAVE_STRING
# include <string>
#endif
#ifdef HAVE_FSTREAM
# include <fstream>
#endif
#ifdef HAVE_VECTOR
# include <vector>
#endif
#ifdef HAVE_MEMORY
# include <memory>
#endif
#ifdef HAVE_CTIME
# include <ctime>
#endif
#ifdef HAVE_CSTDIO
# include <cstdio>
#endif
#ifdef HAVE_CSTDLIB
# include <cstdlib>
#endif
#ifdef HAVE_CTYPE_H
# include <ctype.h>
#endif
#ifdef HAVE_LTDL_H
# include <ltdl.h>
#endif
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif
#ifdef HAVE_STDIO_H
# include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_HPDF_H
# include <hpdf.h>
#endif
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#ifdef HAVE_CMATH
# include <cmath>
#endif

#endif /*__CONFIG_H__*/
])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([caixa.menu caixa.directory caixa-geral.desktop caixa-caixa.desktop caixa-escritura.desktop Makefile src/Makefile])

#Depencias estáticas (Bibliotecas)
AC_CONFIG_SUBDIRS([libex libbancopg libbancomy libhpdf])

AC_OUTPUT
